<template>
	<view class="tag-container">
		<view class="tag-list">
			<view class="item"  @tap="$tool.toPage(`/pages/topic/topicList?title=${item.title}&tagId=${item.id}`)" v-for="(item, index) in tagList">
				<image mode="aspectFill" class="thumb" :src="item.thumb"></image>
				<view class="title">#{{item.title}}</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				tagList: [],
				day:0
			}
		},
		computed: {},
		watch: {},
		onLoad() {
			uni.showLoading({
				title: '加载中'
			})
			this.initData().then(res => {
				uni.hideLoading()
			})
		},
		onShow() {
			this.initData()
		},
		onPullDownRefresh() {
			this.$showPullRefresh()

			this.initData()
		},
		methods: {
			st_loadData(){
				let st = true;
				if(st == 1){
					console.info(1)
				}
			},
			st_list(){
				let status = true;
				if(status){
					status = false;
					console.info(222)
				}
			},
			st_pay(){
				let s = 1;
				if(s == 1){
			
				}else if(s == 2){
				
				}
			},
			initData() {
				return this.$http('/topic-tags', 'GET', {
					'per_page': 1000
				}).then(res => {
					this.tagList = res.data.list
				})
			}
		},
		onPageScroll(e) {}
	}
</script>

<style lang="scss" scoped>
	.tag-container {

		.tag-list {
			width: 100%;
			padding: 0rpx 30rpx 60rpx 30rpx;
			box-sizing: border-box;
			// white-space: nowrap;
			display: flex;
			flex-wrap: wrap;
			// margin-left: 30rpx;
			justify-content: space-between;

			.item {
				margin-top: 20rpx;
				// border: 1px solid blue;
				box-shadow: 0px 14px 30px 0px rgba(226, 222, 204, 0.4);
				padding: 10rpx 12rpx;
				border-radius: 20rpx;
				// display: flex;
				align-items: center;
				flex-direction: column;
				// margin-right: 16rpx;

				.thumb {
					width: 198rpx;
					height: 238rpx;
					border-radius: 40rpx;
				}

				.title {
					font-size: 26rpx;
					font-weight: 500;
					color: #000000;
					line-height: 40rpx;
					margin-top: 10rpx;
					text-align: center;
					width: 200rpx;
					text-align: center;

					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 1;
					-webkit-box-orient: vertical;
				}
			}
		}

	}
	
	.st_main{
		background-color: transparent;
		font-size: 28rpx;
		font-weight: bold;
		display: flex;
		flex-direction: row;
	}
	.st_list{
		background-color: transparent;
		display: flex;
		font-size: 28rpx;
	}
</style>
